package com.owc.common.exception;

import com.owc.common.enums.ExceptionEnum;

import java.util.function.Supplier;

public abstract class OWCException extends RuntimeException {

    private ExceptionEnum exceptionEnum = ExceptionEnum.UNKNOWN_ERR;

    private Integer code = exceptionEnum.getCode();

    private String message = exceptionEnum.getMessage();

    public OWCException(String message) {
        this.message = message;
    }

    public OWCException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public OWCException(String message, Throwable cause) {
        super(message, cause);
    }

    public OWCException() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
